<?php
/**
 * Created by PhpStorm.
 * User: yucheng
 * Date: 2017/11/27
 * Time: 18:57
 */

namespace app\admin\model;

use think\facade\Session;
use think\Model;

class User extends Model
{
	/**
	 * 获取当前登录用户id
	 * @return mixed
	 */
	public function getLoginUserId()
	{
		$user_id = Session::get('loginUserId');
		return $user_id;
	}

	/**
	 * 当前登录用户的姓名
	 * @return string
	 */
	public function getLoginUserName()
	{
		$dao = new UserDAO($this->db());
		return $dao->getLoginUserName($this->getLoginUserId());
	}
}